<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>保险列表</title>
    <script src="../../../adminthemes/new/js/easy-ui/jquery.min.js"></script>
    <script src="../../../adminthemes/new/js/easy-ui/jquery.easyui.min.js"></script>
    <script src="../../../adminthemes/new/js/easy-ui/easyui-lang-zh_CN.js"></script>
    <script src="../../../adminthemes/new/js/easy-ui/easyloader.js"></script>
</head>
<style type="text/css">
    .table_search button{
        margin-top: 0px!important;
    }
    td input{
        height: 25px;
        border-radius: 3px;
        border: 1px solid #ccc;
    }
    tr{
        height:50px;
    }
    select{
        height:25px;
        border-radius:3px;
    }
    th{
        width: 195px;
        font-size: 12px;
        text-align: center;
    }

</style>
<body>
<form id="search_form" class="layui-form" action="post">
    <div class="layui-form-item">
        <label class="layui-form-label">订单号:</label>
        <div class="layui-input-block">
            <input type="text" id="sn" maxlength="20" lay-verify="title" autocomplete="off" placeholder="请输入订单号" class="layui-input">
        </div>
    </div>

    <ul>
        <li class="reset">
            <button type="reset" id="reset_btn" class="layui-btn  layui-btn-primary">重置</button>
        </li>
        <li class="submit">
            <button type="button"  class="layui-btn layui-btn-primary"  onclick="highSearchOrder()" lay-submit="" lay-filter="highsearch" >开始搜索</button>
        </li>
    </ul>
</form>
<table id="InPolicyTable" class="layui-table site-table table-hover">
    <thead>
    <tr>
        <th>保险名称</th>
        <th>供应商</th>
        <th>保险编号</th>
        <th>保险价格</th>
        <th>保险费率</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>

</table>
</body>
</html>
<script type="text/javascript">
    $(function () {
        table = $('#goodsdata').DataTable({
            "language": {
                "url": "${staticserver}/media/zh_CN.txt"
            },
            "processing": true,
            "serverSide": true,
            "ordering": false,
            "searching": false,
            "lengthChange": false,
            ajax: {
                //指定数据源
                type:"post",
                url: "/web/InsuranceManage/getAllInspolicy.do",
            },
            columns: [ //定义列
                {"data": function (obj) {
                        return obj.name;
                    }},
                {data: function(obj){
                        return obj.supplier_id;
                    }},
                {data: function (obj) {
                        return '￥'+obj.price;
                    }},
                {data: function (obj) {
                        return obj.insured_subsidies;
                    }},
                {data: function (obj) {
                        if(obj.market_enable==1){
                            return "售卖中";
                        }else if(obj.market_enable==0){
                            return "已下架";
                        }else{
                            return "预览商品";
                        }
                    }},
                {data: function (obj) {
                        return "<a class='layui-btn layui-btn-small _aa' name='change_btn' onclick='newTab(\""+obj.name+"\",\"${ctx}/shop/admin/goods/edit.do?goodsId="+obj.goods_id+"\")' >操作</a>";		//获取值:data["brand_id"]
                    }}
            ]
        });

    })














    function highSearchOrder(){
        var start_time = $("#start_time").val();
        var end_time = $('#end_time').val();
        var sn = $("#sn").val();
        var ship_name = $("#ship_name").val();
        var status = $("#status").val();
        var paystatus = $("#paystatus").val();
        var shipstatus = $("#shipstatus").val();
        var shipping_type = $("#shipping_type").val();
        var payment_id = $("#payment_id").val();
        var param = "&start_time="+start_time+"&end_time="+end_time+"&sn="+sn+"&ship_name="+ship_name+"&status="+status+"&paystatus="+paystatus+"&shipstatus="+shipstatus+"&shipping_type="+shipping_type+"&payment_id="+payment_id;
        table.ajax.url(ctx+"/shop/admin/order/list-json.do?order_state=${orderstate!''}"+param+"&stype="+1).load();
    }




</script>